<?php
declare (strict_types = 1);

namespace app\demo\controller;

use app\common\controller\SystemBaseController;
use app\system\facade\UserService;
use hg\apidoc\annotation as Apidoc;

/**
 * 数据字典
 * @Apidoc\Group("demo")
 * @author 贾二小
 * @since 2021/10/30
 */
class Index extends SystemBaseController
{
    public function index()
    {
        return '您好！这是一个[admin]示例应用';
    }

    /**
     * @Apidoc\Title("获取最新版本号")
     * @author 贾二小
     * @since 2021/11/20
     */
    public function ver()
    {
        self::success(['version'=>'1.4.0']);
    }

    /**
     * @Apidoc\Title("模拟POST提交")
     * @author 贾二小
     * @since 2021/11/23
     */
    public function post()
    {
        self::success([]);
    }

    public function dic()
    {
        $data = [
            ['value'=>"1",'label'=>"发布通知"],
            ['value'=>"2",'label'=>"转发通知"],
            ['value'=>"3",'label'=>"事务通知"],
        ];
        self::success($data);
    }

    public function page()
    {
        //获取数据
        $data = UserService::tableList([]);
        self::table($data);
    }
}
